package com.umakr.ax;

import com.umakr.ax.core.aspect.DataSourceAspect;
import com.umakr.ax.core.filter.CurrentHttpRequestFilter;
import com.umakr.ax.core.support.i18n.LocaleMessageSourceService;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author Administrator
 * @date 2017/4/8
 */
@Configuration
@ConditionalOnBase
public class BaseConfig{

    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new CurrentHttpRequestFilter());
        return filterRegistrationBean;
    }

    @Bean
    public DataSourceAspect dataSourceAspect(){
        return new DataSourceAspect();
    }
    @Bean
    public LocaleMessageSourceService localeMessageSourceService(){
        return new LocaleMessageSourceService();
    }

}
